home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BMUG PD-ROM B4
/
PD-ROM B4.iso
/
Entertainment
/
Strategy
/
Robots
/
Mech Zone
/
Sample Robots
/
Topper
< prev
Wrap
Text File
|
1991-09-07
|
2KB
|
72 lines
` Totally modular implementation of Topper.
Equip 4 0 0 10 0 260
` Go to top of screen.
while ycoord > 1 begin
if enginestat = 0 then engineon
objectscan 0
while range > 0 begin
zap
objectscan 0
end ` {while range > 0}
if ycoord > 1 then begin
if enginestat = 0 then engineon
if decoy > 0 then dropdecoy
if enginestat = 1 then wait 1
end ` {if ycoord}
end ` {while}
if enginestat = 1 then engineoff
while 1 = 1 begin
let swivelamt = 90 - headfacing
if swivelamt <> 0 then swivel swivelamt
objectscan 90
if range > 0 then let targetdir = 3
else let targetdir = 7
gosub 1000 `{turnto targetdir}
engineon
let swivelamt = 0 - bearing
if swivelamt <> 0 then swivel swivelamt
objectscan 0
while range > 0 begin
zap
objectscan 0
end
else begin
if enginestat = 0 then engineon
let swivelamt = 180 - headfacing
if swivelamt <> 0 then swivel swivelamt ` "If" probably unnecessary.
objectscan 0
while range = 0 begin
if decoy > 0 then dropdecoy
objectscan 0
end
while range > 0 begin
if enginestat = 1 then engineoff
zap
objectscan 0
end
end
end
` Subroutine to turn robot toward a given targetdir.
1000 let turnto = 1 ` Dummy code for cosmetic purposes.
if targetdir <> bodyfacing then begin
let turndir = targetdir - bodyfacing
if turndir < 0 then let turndir = turndir + 8
if turndir > 4 then let turndir = turndir - 8
while bodyfacing <> targetdir begin
turn turndir
let debug2 = targetdir
let debug3 = bodyfacing
if bodyfacing = targetdir then zap
else let debug1 = 4
end
end
return